#!/usr/bin/perl

use Data::Dumper;
use List::Util;

open EXFILE,"excescis.txt.all";
@total=<EXFILE>;
close(EXFILE);

$oneline=join(undef,@total);
@orderd=split(/\n\n/,$oneline);  # 空行分段
$tt=@orderd;
# print Dumper(@orderd);
@orderd=List::Util::shuffle @orderd;

$number=0;
foreach $o(@orderd){
	$number++;	
	@item=split(/\n/,$o);
	foreach $ii(@item){
		if($ii=~/\d.(.*)/){  # 标号开头的句子
			print "$number\]. $1\n";
			next;
		}
		if($ii=~/A.(.*) B.(.*) C.(.*) D.(.*)/){   # 带有ABCD的选择项。
			@answer=($1,$2,$3,$4);
			@answer=List::Util::shuffle @answer;
			print "     A.$answer[0] B.$answer[1] C.$answer[2] D.$answer[3]\n";
		
		}else{
			print "     $ii\n";
		}
	}
	print "\n";

}
